/**
	Boost Logging library

	Author: John Torjo, www.torjo.com

	Copyright (C) 2007 John Torjo (see www.torjo.com for email)

	Distributed under the Boost Software License, Version 1.0.
	(See accompanying file LICENSE_1_0.txt or copy at
		  http://www.boost.org/LICENSE_1_0.txt)

	See http://www.boost.org for updates, documentation, and revision history.
	See http://www.torjo.com/log2/ for more details
*/

#ifndef LOGGER_HPP_GUARD
#define LOGGER_HPP_GUARD

#include "boost_pch.hpp"

using namespace std;

// Step 1: Optimize : use a cache string, to make formatting the message faster
BOOST_LOG_FORMAT_MSG( optimize::cache_string_one_str<> ) 

// Step 2 : Specify your logging class(es)
typedef boost::logging::logger_format_write< > log_type;

// Step 3: declare which filters and loggers you'll use
BOOST_DECLARE_LOG_FILTER(g_l_filter, boost::logging::level::holder)
BOOST_DECLARE_LOG(g_l, log_type)

// Step 4: define the macros through which you'll log
#define DBG_LOGGER BOOST_LOG_USE_LOG_IF_LEVEL(g_l(), g_l_filter(), debug ) << "[dbg] "
#define ERR_LOGGER BOOST_LOG_USE_LOG_IF_LEVEL(g_l(), g_l_filter(), error ) << "[ERR] "
#define INF_LOGGER BOOST_LOG_USE_LOG_IF_LEVEL(g_l(), g_l_filter(), info )
#define APP_LOGGER(lvl) BOOST_LOG_USE_LOG_IF_LEVEL(g_l(), g_l_filter(), lvl )

// impossible since replaced by if ... else statement
// basic_ostringstream<char> & getLogger(boost::logging::level::type type);

void initLogger(std::string logFile, bool isCout);

#endif